﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CommandMenu.cs" company="">
//   
// </copyright>
// <summary>
//   The command menu.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Libium.UseCases
{
    using System.Collections.Generic;

    /// <summary>
    ///   The command menu.
    /// </summary>
    public class CommandMenu : ViewBindable, ICommandMenu
    {
        #region Fields

        /// <summary>
        ///   The _commands.
        /// </summary>
        private readonly List<ICommand> _commands = new List<ICommand>();

        #endregion

        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="CommandMenu"/> class.
        /// </summary>
        /// <param name="name">
        /// The name. 
        /// </param>
        public CommandMenu(string name)
        {
            Text = name;
        }

        #endregion

        #region Public Properties

        /// <summary>
        ///   Gets the commands.
        /// </summary>
        public IEnumerable<ICommand> Commands
        {
            get
            {
                return _commands;
            }
        }

        /// <summary>
        ///   Gets or sets the description.
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        ///   Gets or sets the text.
        /// </summary>
        public string Text { get; set; }

        #endregion

        #region Public Methods and Operators

        /// <summary>
        /// The add command.
        /// </summary>
        /// <param name="command">
        /// The command. 
        /// </param>
        public void AddCommand(ICommand command)
        {
            _commands.Add(command);
        }

        #endregion
    }
}